Skip to content

Use toggleClass instead of [ bool ? "addClass" : "removeClass" ]#77

Closed
xavi- wants to merge 1 commit intojquery:masterfrom
xavi-:master
Closed

Use toggleClass instead of [ bool ? "addClass" : "removeClass" ]#77
xavi- wants to merge 1 commit intojquery:masterfrom
xavi-:master

Conversation

@xavi-
Copy link
Contributor

@xavi- xavi- commented Dec 19, 2010

Several times in the jquery-ui code base a class is conditionally added to an element using this construct: elem[ bool ? "addClass" : "removeClass" ]("foo"). I propose that $.fn.toggleClass be used instead. I feel this change will make the code less verbose and easier to read.

Ticket #6764

@scottgonzalez
Copy link
Member

Thanks, landed in 956697b.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants